<?php
/**
 * Created by PhpStorm.
 * Author: shishiwenjie
 * Date: 2018/5/19
 * Time: 15:09
 */

namespace app\company\controller;


use think\Controller;
use think\Db;

class Resume extends Controller
{
    //判断是否登录，未登录则进入登录界面
  function index(){
      if( !session('?jigou')){
          return $this->redirect('Users/login');
      }else{
      $Mresume = new \app\company\model\Resume();
      $res=$Mresume->select();
      $this->assign("res",$res);
      return view("resume");
      }
  }
    //导师列表查询
    function select(){
        $address=$_POST['city'];
        $type=$_POST['type'];
        if($address=='全部'){
            $res = Db::name('liewu_teacher')->where('type',$type)->select();
            return['res'=>$res];
        }else {
            $res = Db::name('liewu_teacher')->where('address', $address)->where('type', $type)->select();

            return ['res' => $res];
        }
    }
}